<h3>Manage Modules</h3>
<?php $this->widget('FGridView', array(
    'id'=>'module-grid',
    'dataProvider'=>$model->search(),
    'filter'=>$model,
    'columns'=>array(
        array(
            'class'=>'CCheckBoxColumn',
            'name'=>'Id',
            'value'=>'$data->primaryKey',
        ),
        array(
            'class'=>'FDataColumn',
            'rowActions'=>array(
                'template'=>'{update} | {uninstall}',
                'buttons'=>array(
                    'uninstall'=>array(
                        'label'=>'Uninstall',
                        'url'=>'"#"',
                    ),
                )
            ),
            'name'=>'Name',
            'type'=>'html',
            'value'=>'($data->Enabled==Module::ENABLED_YES ? "<strong>".$data->Name."</strong>" : $data->Name)',
            'htmlOptions'=>array('class'=>'alignLeft'),
        ),
        array(
            'name'=>'Title',
            'type'=>'html',
            'value'=>'($data->Enabled==Module::ENABLED_YES ? "<strong>".$data->Title."</strong>" : $data->Title)',
            'htmlOptions'=>array('class'=>'alignLeft'),
        ),
        array(
            'name'=>'Author',
            'value'=>'$data->Author',
            'filter'=>false,
        ),
        array(
            'name'=>'Version',
            'value'=>'$data->Version',
            'filter'=>false,
        ),
        array(
            'name'=>'TablePrefix',
            'value'=>'$data->TablePrefix',
            'filter'=>false,
        ),
        array(
            'name'=>'IsSystem',
            'value'=>'$data->getIsSystemText()',
            'filter'=>false,
        ),
        array(
            'name'=>'Enabled',
            'type'=>'html',
            'value'=>'$data->getEnabledText()',
            'filter'=>$model->getEnabledOptions(),
        ),
    ),
)); ?>
<?php echo CHtml::link('Rebuild cache', array('/Core/modules/rebuildCache'));?>
<?php
$cs = Yii::app()->ClientScript;
$cs->registerScript('enabled', "
\$('#module-grid a.enabled').live('click',function() {
    \$.fn.yiiGridView.update('module-grid', {
        type:'POST',
        url:\$(this).attr('href'),
        success:function() {
            \$.fn.yiiGridView.update('module-grid', {cacheResponse:false});
        }
    });
    return false;
});
");
?>
